package com.bite.forum.dao;

import com.bite.forum.model.Message;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MessageMapper {
    int insert(Message row);

    int insertSelective(Message row);

    Message selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Message row);

    int updateByPrimaryKey(Message row);

    /**
     * 获取未读信息
     * @param receiveUserId 接收者Id
     * @return 未读信息数量
     */
    Integer selectUnreadCount(@Param("receiveUserId") Long receiveUserId);

    /**
     * 获取接收者信息
     * @param receiveUserId 接收者Id
     * @return 接收者信息
     */
    List<Message> selectByReceiveUserId(@Param("receiveUserId") Long receiveUserId);
}